"""
嘉联支付开放平台SDK异常类定义模块
"""


class JlpayException(Exception):
    """嘉联支付SDK基础异常类"""
    
    def __init__(self, message):
        self.message = message
        super().__init__(self.message)


class HttpExecutionException(JlpayException):
    """HTTP执行异常类"""
    
    def __init__(self, message, cause=None):
        self.cause = cause
        super().__init__(message)


class HttpStatusCodeException(JlpayException):
    """HTTP状态码异常类"""
    
    def __init__(self, status_code, response_body=None):
        self.status_code = status_code
        self.response_body = response_body
        message = f"HTTP请求返回非成功状态码: {status_code}, 响应内容: {response_body}"
        super().__init__(message)


class SignVerifyException(JlpayException):
    """签名验证异常类"""
    
    def __init__(self, message):
        super().__init__(message)


class KeyInitializationException(JlpayException):
    """密钥初始化异常类"""
    
    def __init__(self, message, cause=None):
        self.cause = cause
        super().__init__(message)


class ConfigException(JlpayException):
    """配置异常类"""
    
    def __init__(self, message):
        super().__init__(message)


class CryptoException(JlpayException):
    """加解密异常类"""
    
    def __init__(self, message, cause=None):
        self.cause = cause
        super().__init__(message) 